<!DOCTYPE html>
<!-- saved from url=(0071)http://www.uphsh.com/wap/ef73d9dc381d412f964b99e521c270a6/invoice/addUI -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!--<base href="http://www.uphsh.com:80/">--><base href=".">
<title>新户注册</title>


<meta name="description" content="新户注册">
<meta name="keywords" content="新户注册">
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">

	<link type="text/css" href="../../resource/xhzc/wapcommon.css" rel="stylesheet">
	<link rel="stylesheet" href="../../resource/weuimin.css"/>
	<script src="../../resource/jquery1.js"></script>
	<script type="text/javascript" src="../../resource/common.js"></script>
	<script src="../../resource/tjxxfiles/jquery180min.js" type="text/javascript"></script>
	<script type="text/javascript" src="../../resource/tjxxfiles/wapcommon.js"></script>
    <script src="../../script/api.js"></script>
    <script type="text/javascript" src="../../script/aes.js"></script>
	<script type="text/javascript" charset="UTF-8" src="../../script/naes.js"></script>
	<script type="text/javascript" src="../../script/modeecb.js"></script>
  <script type="text/javascript" src="../../script/tmd5.js"></script>
	<script type="text/javascript" src="../../script/constants.js"></script>

		<!--map.js和my.js-->
		<script type="text/javascript" src="../../resource/xhzc/map.js"></script>
		<script type="text/javascript" src="../../resource/xhzc/my.js"></script>
	<style>
		#scale{
		background: transparent none;
		color: rgb(0, 0, 0);
		width: 10%;
		line-height: 20px;
		text-indent: 8px;
		height: 20px;
		margin-top: 10px;
		margin-right: 0px;
		margin-left: 15px;
		vertical-align: baseline;
		border: 1px solid #e0e0e0;
		}

		.formContent input[type=checkbox] {
			background: transparent none;
			color: rgb(0, 0, 0);
			width: 10%;
			line-height: 20px;
			text-indent: 8px;
			height: 20px;
			margin-top: 10px;
			margin-right: 0px;
			margin-left: 15px;
			vertical-align: baseline;
			border: 1px solid #e0e0e0;
		}


		#scalab{
		margin-bottom: 20px;
		}

		#scadd{
		margin-bottom: 20px;
		}

		.bg {
			background: #27a8fa;
			overflow: hidden;
			padding: 5px 0 15px;
			margin-left: 25px;
		}

		.center { margin: 0 auto; }
		.tc { text-align: center;color: #fff; }

		.bg input {
			background: transparent none;
			color: rgb(0, 0, 0);
			width: 90%;
			line-height: 40px;
			text-indent: 8px;
			height: 30px;
			vertical-align: baseline;
			border: 1px solid #e0e0e0;
		}

		.bg dl {
			width: 100%;
			height: 40px;
			line-height: 40px;
			clear: both;
			float: left;
			margin: 5px 0;
			position: relative;
		}

		.bg dt {
			text-align: right;
			float: left;
			margin-right: 5px;
			width: 80px;
			color: #fff;
		}

		.bg dd {
			margin-left: 85px;
			margin-right: 5px;
			display: block;
			width: auto;
		}

		.bg #jspName {
			background: white;
		}

	.product input[type='radio']{
		width: 1.5rem;
		height: 1.5rem;
		margin: 0 4  1 3;/*margin: 0 .4rem .1rem .3rem;*/
		border: none;
		background:  no-repeat center/1.5rem 1.5rem;
	}

	.product input[type='text'] {
		background: transparent none;
		color: rgb(0, 0, 0);
		width: 100%;
		line-height: 40px;
		text-indent: 8px;
		height: 40px;
		vertical-align: baseline;
		border: 1px solid #e0e0e0;
	}

	.hydzsel{width:71%;text-align:right;margin:0 3% 0% 0;padding:4px;border:1px solid #f7bfbf;}
	.dzsel{width:21%;text-align:right;margin:0 3% 0% 0;padding:4px;border:1px solid #f7bfbf;}
	.dzdiv{text-align:right;}
	.hydzdiv{text-align:right;}
	</style>
</head>
<body>
<header id="statusBar">
	<div class="header">
        <div class="return">
			<a style="color:#fff" onclick="api.closeWin();" tapmode="presshover">
							<span>返回</span>
					</a>
        </div>
        <div class="tittle">
    		信息录入
        </div>
    </div>
    </header>
    <div id="contant" style="height: 563px;">
	    <div id="loadingToast" style="display:none;">
        <div class="weui-mask_transparent"></div>
        <div class="weui-toast">
            <i class="weui-loading weui-icon_toast"></i>
            <p class="weui-toast__content">请稍后...</p>
        </div>
	   </div>
	    	<div class="formContent">
	    		<dl>
	    			<dt>单位名称&nbsp;:</dt>
	    			<dd><input type="text" name="mc" id="userName" style="font-size:18px;" placeholder="请输入单位名称" value="" ></dd>
	    		</dl>
	    		<dl>
	    			<dt>单位税号&nbsp;:</dt>
	    			<dd><input type="text" name="taxcode" id="taxCode" style="font-size:18px;" data-style="english" data-format="uppercase" placeholder="请输入税号" value="" ></dd>
	    		</dl>
	    	</div>
	    	<div class="hydzdiv">
	    		<dl>
	    			<dd>行业类型&nbsp;:&nbsp;<select class="hydzsel"  id="hytype" >
  								</select></dd>
	    			</dl>
	    	</div>
			<div class="formContent">		
					<dl>
	    			<dt>法人代表&nbsp;:</dt>
	    			<dd><input type="text" name="frdb" style="font-size:18px;" id="frdb" placeholder="请输入法人代表" value="" ></dd>
	    		</dl>
					<dl>
	    			<dt>注册资本&nbsp;:</dt>
	    			<dd><input type="text" name="zczb" style="font-size:18px;" id="zczb" placeholder="请输入注册资本" value="" ></dd>
	    		</dl>
	    		<dl>
	    			<dt>单位地址&nbsp;:</dt>
	    			<dd><input type="text" name="yydz" style="font-size:18px;" id="address" placeholder="请输入单位地址" value=""></dd>
	    		</dl>
	    		<dl>
	    			<dt>联系电话&nbsp;:</dt>
	    			<dd><input type="tel" name="dhhm" style="font-size:18px;" id="phoneNumber" placeholder="请输入单位联系电话" value="" data-maxlength="15"></dd>
	    		</dl>
	    	</div>
	    	
	    	<div class="dzdiv">
	    		<dl>
	    			<dd><select class="dzsel"  id="address_sheng" onchange="loadShi()">
  								</select>
  								<select class="dzsel" id="address_shi" onchange="dqdm()">
  								</select>
  								<select class="dzsel" id="address_qx" onchange="dqdm1()">
  								</select></dd>
	    		</dl>
	    	</div>
	    		
	    	<div class="formContent">
				<dl>
	    			<dt>所属税局&nbsp;:</dt>
	    			<dd><input type="text" style="font-size:18px;" name="sssj" id="sssj"  value="" data-maxlength="28" data-style="cardno"></dd>
	    		</dl>
					<!--<dl>
	    			<dt>行政区划&nbsp;:</dt>
	    			<dd><input type="text" style="font-size:18px;" name="xzqh" id="xzqh" placeholder="请输入行政区划" value="" data-maxlength="28" data-style="cardno"></dd>
	    		</dl>-->
	    		<dl>
	    			<dt>开户银行&nbsp;:</dt>
	    			<dd><input type="text" style="font-size:18px;" name="yh" id="bankName" placeholder="请输入开户银行" value=""></dd>
	    		</dl>
	    		<dl>
	    			<dt>银行帐号&nbsp;:</dt>
	    			<dd><input type="text" style="font-size:18px;" name="zh" id="bankNumber" placeholder="请输入银行帐号" value="" data-maxlength="28" data-style="cardno"></dd>
	    		</dl>
	    		<dl>
	    			<dt>合同编号&nbsp;:</dt>
	    			<dd><input type="text" style="font-size:18px;" name="contract" id="contract" placeholder="请输入合同编号" value="" data-maxlength="28" data-style="cardno"></dd>
	    		</dl>

	    	</div>

				<div class="product">
					<dl style="display:none">
	    			<dt>单位类型&nbsp;:</dt>
						<dd><label style="margin-left:6%"><input id="dwlxy" type="radio" value=""  name="dwlx"/> 个人 </label>
						<label style="margin-left:6%"><input id="dwlxyn" type="radio" value="" name="dwlx" checked="true"/> 企业 </label> </dd>
	    		</dl>
					<dl>
						<dt>达到起征点&nbsp;:</dt>
						<dd><input id="qzdy" type="radio" value=""  name="qzd" checked="true"  style="margin-left:6%" /><label for="qzdy">是</label>
						<!--<input id="qzdn" type="radio" value="" name="qzd" style="margin-left:10%;"/><label for="qzdn">否</label>--></dd>
					</dl>
					<dl id="xgmdl">
						<dt>是否小规模&nbsp;:</dt>
						<dd><input id="xgmy" type="radio" value=""  name="xgm"  style="margin-left:6%"/><label for="xgmy">是</label>
						<input id="xgmn" type="radio" value="" name="xgm"  style="margin-left:10%"/><label for="xgmn">否</label></dd>
					</dl>
					<dl>
						<dt>是否代账&nbsp;:</dt>
						<dd><input id="dzy" type="radio" value="" name="sfdz" style="margin-left:6%"/><label for="dzy">是</label>
						<input id="dzn" type="radio" value="" name="sfdz" checked="true" style="margin-left:10%"/><label for="dzn">否</label> </dd>
					</dl>
					<dl>
						<dt>是否被代账&nbsp;:</dt>
						<dd><input  type="radio" value="" id="bdz" name="sfbdz" onclick="checkDz();" style="margin-left:6%"/><label for="bdz">是</label>
						<input type="radio" value="" id="bdzn" name="sfbdz" onclick="checkDz();" checked="true" style="margin-left:10%"/><label for="bdzn">否</label>  <label id="dzlab" style="margin-left:6%;margin-right:6%;margin-top:5%;color:red;display: none;">
						<font size="2">*请输入代账企业</font></label></dd>
					</dl>
					<dl style="width: 100%;display:none;" id="dzdl">
	    			<!--<dt>代账企业&nbsp;:</dt>-->
            <dd><input id="dzqy" style="font-size:18px;" type="text" value="" placeholder="请输入代账企业"/></dd>
	    		</dl>
				</div>

				<div style="margin-left:6%;margin-right:6%;margin-top:5%;color:red;">
				*确定上述信息无误后,请与工程师确认,输入工号查询。
				</div>

				<div class="formContent" style="width: 97%;border:1px solid #e0e0e0;" >
		      <dl>
						<dt style="width: 50%;text-align:left;margin-left:-4%;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;工程师&nbsp;:<span id="engineer" style="border-bottom:1px solid #e0e0e0;width:150px;color:black;font-size:16px;"></span></dt>
		        <dd><input id="worknum" type="text"
					  style="font-size:16px;width: 45%;margin-left:0%;border:1px solid #ADADAD;" placeholder="输入工号搜索" value="">
		           <input type="button" id="search" style="width: 18%;hight:10%;text-align:left;background-color: gray;" value="搜 索" onclick="searhEmpy();" tapmode="presshover"></dd>
		      </dl>
				</div>
	    	<div id="errorInfo"   style="height:20px;text-align: center;color: red;"></div>
	    <div style="padding: 0 10px;">
			<input type="button" id="btn_sub"  class="button" value="下一步" onclick="nextPro();">
		</div>
		<div id="loadingToast" style="display:none;">
 		        <div class="weui-mask_transparent"></div>
 		        <div class="weui-toast">
 		            <i class="weui-loading weui-icon_toast"></i>
 		            <p class="weui-toast__content">数据提交中...</p>
 		        </div>
 			  </div>
   			<div id="msgToast" style="display:none;">
   		        <div class="weui-mask_transparent"></div>
   		        <div class="weui-toast">
   		            <i class="weui-loading weui-icon_toast"></i>
   		            <p class="weui-toast__content">地址数据获取中...</p>
   		        </div>
   			</div>
<div class="copyright">四川航天信息有限公司<br>客户热线：<a href="tel:95113" style="color: gray;">95113</a></div>
</div>

<script>
$(".product input[type='radio']").click(function(){
	//$(".product input[type='radio']").style.background="url(\"../../image/radiob.png\") no-repeat center/1.5rem 1.5rem";
	var radios = document.getElementsByName(this.name);
	for(var i = 0; i<radios.length; i++){
			if(radios[i].checked == true){
					radios[i].style.background="url(\"../../image/radiob.png\") no-repeat center/1.5rem 1.5rem";
			}else{
					radios[i].style.background="no-repeat center/1.5rem 1.5rem";
			}
	}
});
</script>

<script type="text/javascript">
var userInfoMap;//扫描和搜索获取
var lit;//扫描获取基础信息
var lrway;
var map=new Map();//手动输入

apiready=function(){
    if(api.systemType == "ios"){
	   document.getElementById("statusBar").style.background = "#298cb4";
	}
    $api.fixStatusBar( $api.dom('header') );
	var rs=$(".product input[type='radio']");
	for(var i = 0; i<rs.length; i++){
			if(rs[i].checked == true){
					rs[i].style.background="url(\"../../image/radiob.png\") no-repeat center/1.5rem 1.5rem";
			}else{
					rs[i].style.background="no-repeat center/1.5rem 1.5rem";
			}
	}

	api.parseTapmode();
	lrway=$api.getStorage("lrway");
	$("#engineer").html("");

	if(ganv(lrway)=='2'){
		//ptMap(map);//初始手动map
		$("#userName").val(api.pageParam.lit.name);
		$("#taxCode").val(api.pageParam.lit.taxcode);
	}
	userInfoMap = api.pageParam.userInfoMap;
	//lit=api.pageParam.lit;
	if(ganv(lrway)=='1'){
		if(boolValue(userInfoMap)){
				initInfo(userInfoMap);//通过扫描二维码和搜索税号方式
		}
	}
	//
	ldhytype();
	//
	loadSheng();
	//
	

	/*if(boolValue(lit)&&lit!='{}'){
			//initLitInfo(lit);
			//$("#userName").val(ganv(lit.name));
			//$("#taxCode").val(ganv(lit.taxcode));
	}*/
}

//显示单位信息
function initInfo(userInfoMap){
	//$("#userName").val(ganv(userInfoMap.nsrmc));
	//$("#taxCode").val(ganv(userInfoMap.shxydm));
	$("#userName").val(ganv(api.pageParam.name)!=''?ganv(api.pageParam.name):ganv(userInfoMap.nsrmc));
	$("#taxCode").val(ganv(api.pageParam.taxcode));
	$("#cusType").val(ganv(""));//客户类型
	$("#hytype").val(ganv(userInfoMap.hymc));
	$("#frdb").val(ganv(userInfoMap.fddbrxm));
	$("#zczb").val(ganv(userInfoMap.zczb));
	$("#address").val(ganv(userInfoMap.zcdz));
	$("#phoneNumber").val(ganv(userInfoMap.zcdlxdh));
	$("#sssj").val(ganv(userInfoMap.zgswjgmc));//所属税局
	//$("#xzqh").val(ganv(userInfoMap.xzqhmc));//行政区划
}

function checkPro(){
	if(document.getElementById("fwsk").checked){
		//需要扫描税盘条码
		$("#bg").show();//显示扫描界面
	}else{
		$("#bg").hide();
	}

}

function checkDz(){
	if($("#bdz").is(":checked")){
		//核对是否被代账
		$("#dzdl").show();
		$("#dzlab").show();
	 }else{
		$("#dzdl").hide();
		$("#dzlab").hide();
	 }
}


//搜索工程师
function searhEmpy(){
	var worknum=$("#worknum").val();
			if(!boolValue(worknum)){
				api.alert({
				 msg: "请输入工号查询!"
				});
			}else{
				loadHt();//加载界面
				var callback = function(ret, err){
							rmHt();//去除
							if (ret) {
							if(ret.success){
									$("#engineer").html(ret.NAME);
									//赋值userInfoMap或手动时的map
									if(ganv(lrway)=='1'){
										userInfoMap.org_id=ret.ORG_ID;
										userInfoMap.org_name=ret.ORG_NAME;
										//alert(userInfoMap.engineer+" "+userInfoMap.worknum+" "+userInfoMap.org_id);
									}else{
										map.put("org_id",ret.ORG_ID);
										map.put("org_name",ret.ORG_NAME);
									}
							}else{
								api.alert({
								 msg: ret.msg
								});
							}
						 }else{
							 api.alert({
								msg: "服务请求错误,请联系管理员"
							 });
						 }
				}
				var parameter = {"empId":worknum};
				apiAjax(JSON.stringify(parameter),url.shemp,callback);
			}

}

//下一步
function nextPro(){
	//信息是否完全
	if(matchInfo()){
		//信息完善
		//验证手机号
		if(!boolTaxcode($("#taxCode").val().trim())){
			api.alert({
			 msg: "税号有误!"
			});
			$("#taxCode").focus();
		}else if(!(/^\d{1,}$/.test($("#zczb").val().trim()))){
			api.alert({
			 msg: "注册资本有误!"
			});
			$("#zczb").focus();
		}
		else if(!matchPhone($("#phoneNumber").val().trim())){
			api.alert({
			 msg: "联系电话格式有误!"
			});
			$("#phoneNumber").focus();
		}else if(!matchBank($("#bankNumber").val().trim())){
			api.alert({
			 msg: "银行账号格式有误!"
			});
			$("#bankNumber").focus();
		}else{
			var jp = $api.getStorage("dl_phone");
			if (jp == "" || jp == null || jp == "undefined" || typeof(jp) == "undefined") {
				api.alert({
					msg: '请登录'
				}, function(ret, err) {
					api.openWin({
						name: '跳转登陆',
						url: '../login.html'
					});
				});
			}else{
				var parameter;
				if(ganv(lrway)=='1'){
					changeValue();//新户操作信息
					parameter = userInfoMap;
				}else{
					//获取手动输入信息
					getIf(map);
					parameter = map;
				}
								api.openWin({
									name: 'product',
									url: 'product.html',
									pageParam: {
											userInfoMap: parameter
									},
									progress: {
										type: "default", //加载进度效果类型，默认值为 default，取值范围为 default|page，default 等同于 showProgress 参数效果；为 page 时，进度效果为仿浏览器类型，固定在页面的顶部
										title: "", //type 为 default 时显示的加载框标题
										text: "", //type 为 default 时显示的加载框内容
										color: "" //type 为 page 时进度条的颜色，默认值为 #45C01A，支持#FFF，#FFFFFF，rgb(255,255,255)，rgba(255,255,255,1.0)等格式
									}
							});
						/*}
				});*/
			}



		}
	}
}

function matchInfo(){
	if(!boolValue($("#userName").val().trim())){
		api.alert({
		 msg: "请输入单位名称!"
		});
		$("#userName").val("");
		$("#userName").focus();
		return false;
	}else if(!boolValue($("#taxCode").val().trim())){
		api.alert({
		 msg: "请输入单位税号!"
		});
		$("#taxCode").val("");
		$("#taxCode").focus();
		return false;
	}else if(!boolValue($("#hytype").val().trim())||$("#hytype").val().trim()=='0'){
		api.alert({
		 msg: "请选择行业类型!"
		});
		$("#hytype").val("");
		$("#hytype").focus();
		return false;
	}else if(!boolValue($("#frdb").val().trim())){
		api.alert({
		 msg: "请输入法人代表!"
		});
		$("#frdb").val("");
		$("#frdb").focus();
		return false;
	}else if(!boolValue($("#zczb").val().trim())){
		api.alert({
		 msg: "请输入注册资本!"
		});
		$("#zczb").val("");
		$("#zczb").focus();
		return false;
	}else if(!boolValue($("#address").val().trim())){
		api.alert({
		 msg: "请输入单位地址!"
		});
		$("#address").val("");
		$("#address").focus();
		return false;
	}else if(!boolValue($("#phoneNumber").val().trim())){
		api.alert({
		 msg: "请输入联系电话!"
		});
		$("#phoneNumber").val("");
		$("#phoneNumber").focus();
		return false;
	}else if(!boolValue($("#sssj").val().trim())){
		api.alert({
		 msg: "请选择地区以匹配税局!"
		});
		$("#sssj").val("");
		$("#sssj").focus();
		return false;
	}else if(!boolValue($("#bankName").val().trim())){
		api.alert({
		 msg: "请输入开户银行!"
		});
		$("#bankName").val("");
		$("#bankName").focus();
		return false;
	}else if(!boolValue($("#bankNumber").val().trim())){
		api.alert({
		 msg: "请输入银行账号!"
		});
		$("#bankNumber").val("");
		$("#bankNumber").focus();
		return false;
	}else if(!boolValue($("#contract").val().trim())){
		api.alert({
		 msg: "请输入合同编号!"
		});
		$("#contract").val("");
		$("#contract").focus();
		return false;
	}else if($("#bdz").is(":checked")&&!boolValue($("#dzqy").val().trim())){
		api.alert({
		 msg: "请输入代账企业!"
		});
		$("#dzqy").val("");
		$("#dzqy").focus();
		return false;
	}else if(!$("#xgmy").is(":checked")&&!$("#xgmn").is(":checked")){
		api.alert({
		 msg: "请选择是否小规模!"
		});
		return false;
	}else if(!boolValue($("#engineer").html().trim())||!boolValue($("#worknum").val().trim())){
		api.alert({
		 msg: "请搜索工程师工号录入信息!"
		});
		$("#worknum").focus();
		return false;
	}
	/*else if(!document.getElementById("fwsk").checked&&!document.getElementById("sb").checked){
		api.alert({
		 msg: "请选择勾选服务产品!"
		});
		return false;
	}else if(document.getElementById("fwsk").checked&&!boolValue($("#jspName").val().trim())){
			api.alert({
			 msg: "请扫描金税盘获取盘号!"
			});
			return false;
	}*/
	else{
			return true;
	}
}

//获取客户操作信息
function changeValue(){
	//修改客户可以操作的项
	//纳税人名称
	userInfoMap.nsrmc=ganv($("#userName").val());
	//税号
	userInfoMap.shxydm=ganv($("#taxCode").val());
	//客户类型
	userInfoMap.khlx=ganv("企业");
	//行业名称
	userInfoMap.hymc=ganv($("#hytype").val());
	//法人代表
	userInfoMap.fddbrxm=ganv($("#frdb").val());
	//注册资本
	userInfoMap.zczb=ganv($("#zczb").val());


	//获取地址
	userInfoMap.zcdz=ganv($("#address").val());
	//联系电话
	userInfoMap.zcdlxdh=ganv($("#phoneNumber").val());
	//开户银行
	userInfoMap.khyh=ganv($("#bankName").val());
	//银行账号
	userInfoMap.yhzh=ganv($("#bankNumber").val());
	//所属税局
	userInfoMap.zgswjgmc=ganv($("#sssj").val());
	//行政区划
	//userInfoMap.xzqhmc=ganv($("#xzqh").val());

	//是否小规模
	if($("#xgmy").is(":checked")){
		userInfoMap.xgm=ganv("1");
	}else{
		userInfoMap.xgm=ganv("0");
	}

	//是否代账
	if($("#dzy").is(":checked")){
		userInfoMap.sfdz=ganv("1");
	}else{
		userInfoMap.sfdz=ganv("0");
	}

	//是否被代账
	if($("#bdz").is(":checked")){

		userInfoMap.sfbdz=ganv("1");
		//代账企业
		userInfoMap.dzqy=ganv($("#dzqy").val());

	}else{
		userInfoMap.sfbdz=ganv("0");
		//代账企业
		userInfoMap.dzqy="无";
	}

	//是否达到起征点
	if($("#qzdy").is(":checked")){
		userInfoMap.qzd=ganv("1");
	}else{
		userInfoMap.qzd=ganv("0");
	}

	//获取工程师和工程师工号
	userInfoMap.engineer=ganv($("#engineer").html());
	userInfoMap.worknum=ganv($("#worknum").val());
	
	userInfoMap.contract=ganv($("#contract").val());//合同编号

}

//初始化map
function ptMap(cusAndnsrMap){
		//cusAndnsrMap = new Map();
		//
		cusAndnsrMap.put("nsrmc", "");//纳税人名称
		cusAndnsrMap.put("shxydm", "");//税号
		cusAndnsrMap.put("khlx", "");//客户类型
		cusAndnsrMap.put("hymc", "");//行业名称
		cusAndnsrMap.put("fddbrxm", "");//法人代表
		cusAndnsrMap.put("zczb", "");//注册资本
		cusAndnsrMap.put("zcdz", "");//注册地址
		cusAndnsrMap.put("zcdlxdh", "");//注册联系电话
		cusAndnsrMap.put("zgswjgmc", "");//所属税局
		cusAndnsrMap.put("xzqhmc", "");//所属税局
		//
		cusAndnsrMap.put("khyh", "");//开户银行
		cusAndnsrMap.put("yhzh", "");//银行账号
		cusAndnsrMap.put("xgm", "");//是否小规模
		cusAndnsrMap.put("sfdz", "");//是否代账
		cusAndnsrMap.put("sfbdz", "");//是否背带张
		cusAndnsrMap.put("dzqy", "");//代账企业
		//map.put("fwcp", "fwcp");//服务产品  1:防伪税控    2:申报
		cusAndnsrMap.put("fwsk", "");//防伪税控
		cusAndnsrMap.put("sb", "");//申报
		cusAndnsrMap.put("price", "");//服务价格

		cusAndnsrMap.put("jspprice", "");//金税盘价格
		cusAndnsrMap.put("fwskprice", "");//防伪税控服务费
		cusAndnsrMap.put("sbcbprice", "");//申报抄报服务费

		cusAndnsrMap.put("jsph", "");//金税盘号

		cusAndnsrMap.put("engineer", "");//工程师
		cusAndnsrMap.put("worknum", "");//工程师工号
		cusAndnsrMap.put("org_id", "");//公司id
		cusAndnsrMap.put("qzd", "");//是否达到起征点

		cusAndnsrMap.put("pay", "");//支付方式
		cusAndnsrMap.put("hqbz", "2");//获取方式标志

		//默认填写的信息为***********
		cusAndnsrMap.put("gxr", "");//管辖人
		cusAndnsrMap.put("yxbz", "");//有效标志
		cusAndnsrMap.put("sspq", "");//所属片区
		cusAndnsrMap.put("ssfwr", "");//所属服务人
		cusAndnsrMap.put("yjxh", "无");//硬件型号
		cusAndnsrMap.put("rjhj", "无");//软件环境
		cusAndnsrMap.put("syhj", "无");//使用环境
		cusAndnsrMap.put("ydbg", "无");//异地办公
		cusAndnsrMap.put("xzqh", "");//行政区划
		cusAndnsrMap.put("gabm", "");//公安编码
}

//赋值map
function getIf(map){
	//修改客户可以操作的项
	//纳税人名称
	map.put("nsrmc",ganv($("#userName").val()));
	//税号
	map.put("shxydm",ganv($("#taxCode").val()));
	//客户类型
	map.put("khlx",ganv("企业"));
	//行业名称
	map.put("hymc",ganv($("#hytype").val()));
	//法人代表
	map.put("fddbrxm",ganv($("#frdb").val()));
	//注册资本
	map.put("zczb",ganv($("#zczb").val()));


	//获取地址
	map.put("zcdz",ganv($("#address").val()));
	//联系电话
	map.put("zcdlxdh",ganv($("#phoneNumber").val()));
	//开户银行
	map.put("khyh",ganv($("#bankName").val()));
	//银行账号
	map.put("yhzh",ganv($("#bankNumber").val()));
	//所属税局
	map.put("zgswjgmc",ganv($("#sssj").val()));
	//行政区划
	//map.put("xzqhmc",ganv($("#xzqh").val()));

	//是否小规模
	if($("#xgmy").is(":checked")){
		map.put("xgm",ganv("1"));
	}else{
		map.put("xgm",ganv("0"));
	}

	//是否代账
	if($("#dzy").is(":checked")){
		map.put("sfdz",ganv("1"));
	}else{
		map.put("sfdz",ganv("0"));
	}

	//是否被代账
	if($("#bdz").is(":checked")){

		map.put("sfbdz",ganv("1"));
		//代账企业
		map.put("dzqy",ganv($("#dzqy").val()));

	}else{
		map.put("sfbdz",ganv("0"));
		//代账企业
		map.put("dzqy","无");
	}

	//是否达到起征点
	if($("#qzdy").is(":checked")){
		map.put("qzd",ganv("1"));
	}else{
		map.put("qzd",ganv("0"));
	}
	
	map.put("hqbz", "2");//获取方式标志

	//获取工程师和工程师工号
	map.put("engineer",ganv($("#engineer").html()));
	map.put("worknum",ganv($("#worknum").val()));
	//赋值合同
	map.put("contract",ganv($("#contract").val()));
}

//加载行业
function ldhytype(){
	$("#msgToast").show();
      var callback = function(ret, err){ 
          console.log(JSON.stringify(ret));
          if(ret){
              var data = ret.json;

            var html = "<option value=\"0\">请选择</option>";
            for(var i=0;i<data.length;i++){
              html += "<option value=\"" + data[i].INDUSTRY_NAME + "\">"+ data[i].INDUSTRY_NAME + "</option>"
            }
            $("#hytype").html(html);
            $("#msgToast").hide();
            }else{
               api.alert({msg: JSON.stringify(err)});
            } 
          }
      var content = {"hy":"ldhy"};
        apiAjax(JSON.stringify(content),url.ldhy,callback);
}


	function loadSheng(){
		var html = "<option value=\"" + "XH2018" + "\" selected=\"selected\">"+ "四川省 "+ "</option>";
		$("#address_sheng").html(html);
		loadShi();
   		/*$("#msgToast").show();
   		var callback = function(ret, err){
            //console.log(JSON.stringify(ret));
           var data = ret.json;
		    	var html = "";
		    	for(var i=0;i<data.length;i++){
		    		if(data[i].mc.indexOf("四川") == 0){
		    			html += "<option value=\"" + data[i].dm + "\" selected=\"selected\">"+ data[i].mc + "</option>"
		    		}else{
		    			html += "<option value=\"" + data[i].dm + "\">"+ data[i].mc + "</option>";
		    		}
		    		
		    	}
		    	$("#address_sheng").html(html);
		    	$("#msgToast").hide();
		    	/*if(seli == 0){
		    		//判断是省内还是省外
			    	var num = $("#address_sheng").find("option:selected").text().indexOf("四川");
			    	if(num == 0){
			    		$("#zje").html("￥" + parseInt(allPrice));
			    	}else{
			    		$("#zje").html("￥" + (parseInt(allPrice) + 12.00));
			    	}
		    	}
		    	loadShi();*/
        /*}
	    var content = {"dqdm":"100000","openid":"","wlfs":1};
	    apiAjax(JSON.stringify(content),url.dqurl,callback);*/
   	}
   	
   	function loadShi(){
   		$("#sssj").val("");
   		var sdm = $("#address_sheng").val();
   		$("#msgToast").show();
   		var callback = function(ret, err){
            var data = ret.json;
            var html = "<option value=\"0\">请选择</option>";
            for(var i=0;i<data.length;i++){
              html += "<option value=\"" + data[i].ID + "\">"+ data[i].NAME + "</option>"
            }
            $("#address_shi").html(html);
            $("#msgToast").hide();
            dqdm();
          }
      var content = {"dqdm":sdm};
        apiAjax(JSON.stringify(content),url.ldqy,callback);
   	  //清空
   	  /*$("#sssj").val("");
      var sdm = $("#address_sheng").val();
      $("#msgToast").show();
      var callback = function(ret, err){
              //console.log(JSON.stringify(ret));
              var data = ret.json;

            var html = "<option value=\"0\">请选择</option>";
            for(var i=0;i<data.length;i++){
              html += "<option value=\"" + data[i].dm + "\">"+ data[i].mc + "</option>"
            }
            $("#address_shi").html(html);
            $("#msgToast").hide();
            dqdm();
          }
      var content = {"dqdm":sdm,"openid":"","wlfs":1};
        apiAjax(JSON.stringify(content),url.dqurl,callback);*/
    }
    
    function dqdm(){
      $("#sssj").val("");
      $("#msgToast").show();
   		var callback = function(ret, err){
            var data = ret.json;
            var html = "<option value=\"0\">请选择</option>";
            for(var i=0;i<data.length;i++){
              html += "<option value=\"" + data[i].ID + "\">"+ data[i].NAME + "</option>"
            }
            $("#address_qx").html(html);
            //加载税局
        	loadSj();
            $("#msgToast").hide();
          }
      var content = {"dqdm":$("#address_shi").val()};
        apiAjax(JSON.stringify(content),url.ldqy,callback);
      //清空
   	  /*$("#sssj").val("");
      $("#msgToast").show();
      var callback = function(ret, err){
            //console.log(JSON.stringify(ret));
             $("#msgToast").hide();
        var data = ret.json;
        var html = "<option value=\"0\">请选择</option>";
        
        for(var i=0;i<data.length;i++){
          html += "<option value=\"" + data[i].dm + "\">"+ data[i].mc + "</option>"
        }
        $("#address_qx").html(html);
        //加载税局
        loadSj();
        }
      var content = {"dqdm":$("#address_shi").val(),"openid":"","wlfs":1};
      apiAjax(JSON.stringify(content),url.dqurl,callback);*/
    }
    
    function dqdm1(){
      //清空
   	  $("#sssj").val("");//$("#address_qx").find("option:selected").text()
   	  //查询税局
   	  loadSj();   	  
    }
    
    var ssj="";
    function loadSj(){
    	var sheng=$("#address_sheng").find("option:selected").text();
    	var shi=$("#address_shi").find("option:selected").text();
    	var qx=$("#address_qx").find("option:selected").text();   	
    	//alert(sheng+shi+qx);
    	if(sheng.indexOf("四川")!=-1){//省份为四川
    		if(shi=='请选择'){
    			$("#sssj").val("四川省国家税务局");
    		}else{
    			if(qx=='请选择'){
    				if(shi.indexOf("阿坝")!=-1){
    					$("#sssj").val("阿坝州国家税务局");
    				}else if(shi.indexOf("甘孜")!=-1){
    					$("#sssj").val("四川省甘孜州国家税务局");
    				}else if(shi.indexOf("凉山")!=-1){
    					$("#sssj").val("四川省凉山州国家税务局");
    				}else{
    					$("#sssj").val("四川省"+shi+"国家税务局");
    				}
    				ssj=$("#sssj").val();
    			}else{
    				//查询详细至区县税局
    				$("#msgToast").show();
				      var callback = function(ret, err){
				      	$("#msgToast").hide();				      	
				        	if(ret.success){
				        		$("#sssj").val(ret.sj);
				        	}else{
				        		api.alert({
								 msg: ret.msg
								});
				        	}
				        }
				      var content = {"qx":qx,"ssj":ssj};
				      apiAjax(JSON.stringify(content),url.ldsj,callback);
    			}
    			
    		}
    		
    	}else{
    		$("#sssj").val("");
    	}
    	
    }
    


</script>

</body></html>
